import { useLayoutEffect, useState} from 'react'

export default function useTitle(titleName:string) {
  const [title,setTitle] = useState<string>()
  useLayoutEffect(()=>{
    document.title=titleName;
    setTitle(titleName);
  },[titleName])
  return title;
}
